﻿@model IEnumerable<BusinessLayer.Account>

@{
    ViewBag.Title = "Account List";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<div style="font-family:Arial">

<table border="1">
    <tr>
        <th>
            Account_Id
        </th>
        <th>
            Account_Name
        </th>
        <th>
            Account_Pass
        </th>
        <th>
            Account_Email
        </th>
        <th>
            Account_Role
        </th>
        <th>
            Account_Status
        </th>
        <th>
            Date_Register
        </th>
        <th>
            Login_Count
        </th>
        <th>
            Last_Login
        </th>
        <th>
            Action
        </th>
    </tr>

@foreach (var item in Model) {
    @Html.BeginForm("Delete", "Account", new {id=item.Account_Id });
            {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Account_Id)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Account_Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Account_Pass)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Account_Email)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Account_Role)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Account_Status)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Date_Register)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Login_Count)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Last_Login)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
            @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
            
               <input type="button" value="Delete" onclick=" return confirm('Are you sure you want to delete record with Id=@item.Account_Id;')" />
            
        </td>
    </tr>
}
}
</table>
</div>
